﻿

<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->
<%
	StorageMonthOutSearchEvent event = (StorageMonthOutSearchEvent)context.getSessionValue("StorageMonthOutSearchEvent");
	ObjectList list = StorageMonthOut.fetch().search(con,event);
%>

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<%@page import="system.base.StorageMonthOutSrv"%>
<%@page import="java.util.Vector"%>
<%@page import="system.data.StorageMonthOutPageData"%>
<%@page import="framework.core.StringUtil"%>
<script language=javascript>

var list_code = "listStorageMonthOut";

function doSearch()
{

	SetValue("s_WarehouseCode",GetValue("i_WarehouseCode")); //仓库编码
	SetValue("s_BalanceTime",GetValue("i_Year")+ "-" + GetValue("i_Month")); //结算时间
	doCommonSearch();
}

key_InitDefault();
key_RegSubmitHandler(doSearch);
</script>


<%=uiBody%>>

<%@ include file="/framework/menu.jsp"%>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="action_code" value="">
<input type=hidden name="Id" value="">
<input type=hidden name=sortOrder value="1">

<!--查询条件保留区域--> 


<%
String time = event.getBalanceTime();
String year = time.substring(0,4);
String month = time.substring(5,7);
%>
<input type=hidden name="s_WarehouseCode" value="<%=event.getWarehouseCode()%>"> <!--仓库编码-->
<input type=hidden name="s_BalanceTime" value="<%=event.getBalanceTime()%>"> <!--结算时间-->
<input type=hidden name="year" value="<%=year%>"> <!--结算时间-->
<input type=hidden name="month" value="<%=month%>"> <!--结算时间-->

<%@ include file="/framework/list_head.jsp"%>



<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
	int key_tab = 1 ;
%>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			仓库选择：
		</td>
		<%=uiSearchInputTDHead%>>
			<%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode",event.getWarehouseCode(),false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
		</td>		
	</tr>

	<%=uiSearchInputTR%>>
		<%=uiSearchInputTDHead%>>
			选择结算月份：
		</td>
		<%=uiSearchInputTDHead%>>
			<%=SelectManager.viewYearSelect(con,"i_Year", year,false,year,"-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month",month,false,"","-请选择-","","")%>
            <input type="button" value="查询" class="buttons" onclick="doSearch();return false;">&nbsp;<input type="button" value="清空" class="buttons" onclick="doClearEvent();return false;">
		</td>		
	</tr>    

<%=uiSearchEnd%>

<!--列表标题-->
<%=UIManager.addListHeadTitle("单一公司公司材料费用月统计（" + time + "）")%>

<!--********************* Part6:List Area ***************-->
<%=uiListStart%>>

<%
boolean isfirst = Boolean.getBoolean(String.valueOf(context.getSessionValue("isfirst")));
    String menu = (String)context.getSessionValue("choice");
    Vector vec = (Vector)context.getSessionValue(menu);
    String[] warehouseNames = null;
    String money = "";
    if(!isfirst && vec != null && vec.size() > 0){
        warehouseNames = StorageMonthOutSrv.getWarehouseNames(vec);//得到仓库;
        String[] balanceTimes;
        balanceTimes = StorageMonthOutSrv.getBalanceTimes(warehouseNames[0],vec);//得到时间
        money = ((StorageMonthOutPageData)vec.get(0)).getProductMoney();//得到金额
    }
%>

<%int index = 1 ;%>  

    <%=uiListHeadTR%>>
        <%=UIManager.addListHead("公司名称",index++)%>
        <%=UIManager.addListHead("产品金额总计",index++,"num")%>
    <%=uiListHeadTREnd%>>
    
    <%=uiListDataTR[4%2]%> align=center>        
        <%=uiListDataTD%>><%=warehouseNames == null?"":warehouseNames[0] %></td>
        <%=uiListDataTD%>><%=money == null ?"" : StringUtil.showPrice(money) %></td>        
    </tr>
<%=uiListEnd%>
</form>
<%@ include file="/framework/foot.jsp"%>
<!--
	Author    :Benny
	FileName  :/system/base/StorageMonthOutList5001.jsp
-->
